package com.hotels.management.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.hotels.management.base.domain.BaseEntity;

@Entity
@Table(name = "ROOM")
public class Room extends BaseEntity {

	private static final long serialVersionUID = 5930747201513240723L;

	private String number;

	private RoomClass roomClass;

	private Integer floor;
	private Integer berthNumber;

	private List<Furniture> roomFurniture;

	@Column(name = "NUMBER")
	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	@ManyToOne
	@JoinColumn(name = "ROOM_CLASS_ID")
	public RoomClass getRoomClass() {
		return roomClass;
	}

	public void setRoomClass(RoomClass roomClass) {
		this.roomClass = roomClass;
	}

	@Column(name = "FLOOR")
	public Integer getFloor() {
		return floor;
	}

	public void setFloor(Integer floor) {
		this.floor = floor;
	}

	@Column(name = "BERTH_NUMBER")
	public Integer getBerthNumber() {
		return berthNumber;
	}

	public void setBerthNumber(Integer berthNumber) {
		this.berthNumber = berthNumber;
	}

	@OneToMany
	@JoinTable(name = "ROOM_FURNITURE", joinColumns = @JoinColumn(name = "ROOM_ID"), inverseJoinColumns = @JoinColumn(name = "FURNITURE_ID"))
	public List<Furniture> getRoomFurniture() {
		return roomFurniture;
	}

	public void setRoomFurniture(List<Furniture> roomFurniture) {
		this.roomFurniture = roomFurniture;
	}

}
